load TagBlock,EventHeaders

if #msg="Media"
  Gosub TagBlock,"OBJE","Media"
  ShowAll SOUR "Media"
  hideexcess
  
else if #msg="Sources"
  if @count.SOUR+@count.NOTE>0
    newline
    #elabel=local(@tag)
    if @DATE!=""
      #elabel&=" ("&@DATE.user&")"
    endif
    cell static,#elabel
    set width -1 offset 3
    ShowAll NOTE
    ShowAll SOUR
  endif
  hideexcess
  
else
  newline

  ! header on first event
  GoSub EventHeaders
  
  ! event name, check box, and date
  cell static,local(@tag)
  set tabwidth 2 alignment center border square
  cellBackground "Table Cell Background"
  set borderColor "Table Cell Background" borderWidth 1

  tab -2
  hskip 7
  cell CheckBoxEdit
  set tabwidth 1
  if local("<LANG>")="English"
    help "Check if "&local(@tag)&" occurred but nothing else known"
  else
    help local("Check if ordinance occurred but nothing else known")
  endif

  #eventDate=@DATE.view
  show DATE Event
  show PLAC Event

  ! rest in a child window
  cell StructuresLink,OrdinanceDetails,@tag
  set border no width -1
  if more
    set image "details_here"
  else
    set image "details"
  endif
  LinkAll all

  #tagKey=@tag&" details"
  help local("Click to edit")&": "&local(#tagKey)
endif
